package com.tensquare.sms.listener;

import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 发送mq的消费端.
 *
 * @author 宫新程
 * @since 2019/3/9 15:52
 */
@Slf4j
@Component
@RabbitListener(queues = "sms")
public class SmsListener {

  /** 发送短信. */
  @RabbitHandler
  public void sendSms(Map<String, String> map) {
    log.info("sms -> mq消费方收到消息");
    System.out.println("tensquare_sms -> mobile：" + map.get("mobile"));
    System.out.println("tensquare_sms -> checkcode：" + map.get("checkcode"));
  }
}
